package com.amit;

import java.io.IOException;
import java.util.Date;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public  class TestServlet extends  HttpServlet {
	
	
	@Override
	protected void service(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		
		String name=request.getParameter("fname");
		Date dt=new Date();
		if(name==null || name.trim().length()==0)
		{
			name="guest";
		}
		String msg="<h1>Hi "+name+"<br/> you have sent request on"+dt;
		
		response.setContentType("text/html");
		response.getWriter().write(msg);
		
	}
	

}
